package com.study.boot.controller;

import com.study.boot.event.pub.NotifyPublisher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author fangdengfu
 * @date 2020/7/4 10:44
 */
@RestController
@Slf4j
@RequestMapping("e")
public class EventController {


    @Resource
    NotifyPublisher notifyPublisher;

    @GetMapping("event")
    public String notifyEvent(@RequestParam String msg) {
        notifyPublisher.publishEvent(msg);
        return msg;
    }

}
